1. Field of the Invention
The present invention relates generally to the field of software development tools and more particularly relates to a system for maintaining control of various versions of a file and for merging different versions of the same file.
2. Description of the Relevant Art
An important type of software development tool manages multiple versions of a common text file. e.g., a program. Typically, this function is required in a software development environment where programs are revised frequently, often by different people, and where previous versions must be preserved. Also, it may be required to merge the changes introduced into independent versions of a common file.
One approach to developing such a management system is described in an article by Tichy entitled "RCS-A System for Version Control", Software-Practice and Experience. John Wiley & Sons, N.Y., 1985, pp. 637-654. That article describes common methods for preserving every version of a file and for merging versions of the same file.
Turning first to the method of preserving versions, the delta method is described in the abovereferenced article. A delta is a series of edit commands that change one version into another. A delta may be a forward delta, for changing a given version into the immediately following version, or a reverse delta, for changing a given version into an immediately preceding version.
A reverse delta system is often preferred because experience shows that often the most frequently required version is the last version created. In a reverse delta system, the last version is stored intact and may be immediately accessed. Text files of previous versions must be created by successively applying reverse deltas to the last version created.
A significant limitation in using the delta system to create a text file of a version separated from the last version by several intermediate versions is that each intermediate version must be created and changed by the appropriate delta. This iterative process limits the speed of accessing intermediate versions.
A given file may develop along a single path where each version evolves from the immediately preceding version. Often however, development of a file may proceed along several independent paths. For example. a first programmer may check out a given file and proceed to create several versions along a first path. A second programmer may check out the same given file and proceed to create several versions along a second path. The changes introduced along the first and second paths may be completely independent, e.g.. the two programmers might not talk to each other and have different development goals. The paths are related since they diverge from the same given file.
In some cases, it may be desirable to merge two versions created along independent paths to form a resulting version incorporating the changes introduced along both paths. For example, referring to the example above, the first programmer may be improving a first aspect of the given program and the second programmer may be improving a second aspect. When they have completed their tasks, a new program improved in both aspects may be created by merging versions from the two paths.
A problem in merging occurs when the same line of the given program is changed in both versions to be merged. It is possible that the changes made will conflict and not be compilable. Accordingly, merge programs have been developed including rules for processing lines changed in both versions.
In many existing systems, the lines included in a given version are identified by line numbers. During a merge, the line numbers in the versions to be merged are compared and lines identified by specified line numbers are included in a resulting version. However, often lines will be duplicated in the resulting version because identical lines will have different line numbers in the versions to be merged.
Accordingly, there is a need for improved software development tools having efficient systems for preserving development versions of a text file, creating desired versions, and merging versions developed along independent paths.